<template>
	<view>
						<view class="address-box">
											<view class="address" @click="goAddress" v-if="JSON.stringify(address) !== '{}' ">
															<view class="address-top">
																			<view class="person">收货人：{{address.userName}}</view>
																			<view class="tel">电话：{{address.telNumber}} <uni-icons type="right"></uni-icons></view>
															</view>
															<view class="address-bottom">
																			<view class="info" >收货地址：{{ addStr }}</view>
																			
															</view>
											</view>
										<view class="addAddress" v-else>
														<button @click="goAddress"  type="primary" style="width: 300rpx;height: 60rpx;font-size: 30rpx;line-height: 60rpx;">
																			请添加收货地址+
														</button>
										</view>
						</view>
						
	</view>
	
</template>

<script>
	import { mapGetters } from 'vuex'
	export default {
		name:'address',
		data() {
			return { addInfo:'' }
		},
		props:{
				address:{
							type:Object,
							default:{}
				},
		},
		
		onLoad(){
			
		},
		methods:{
				goAddress(){
					  this.$emit('goAddress')
				},
		},
		computed:{ ...mapGetters('user',['addStr']) }
	}
</script>

<style lang="scss">

		.address-box{
			width: 100%;
			height: 100rpx;
			.addAddress{
						display: flex;
						justify-content: center;
						padding-top: 30rpx;
			}
		}
			.address{
						font-size:28rpx ;
						padding: 0 15rpx;
						.address-top{
							  display: flex;
								justify-content: space-between;
								margin: 20rpx 0;
						}
						.address-bottom{
								.info{
										margin-bottom: 40rpx;
								}
						}
			}
			
</style>